package com.example.computer_exam_training_sys.service.impl;

import com.example.computer_exam_training_sys.entity.User_Exams_entity;
import com.example.computer_exam_training_sys.mapper.User_Exams_Mapper;
import com.example.computer_exam_training_sys.service.User_Exams_Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
public class User_Exams_impl implements User_Exams_Service {
    @Autowired
    private User_Exams_Mapper user_exams_Mapper;

    @Override
    public List<User_Exams_entity> findallexams() {
        return user_exams_Mapper.findallexams();
    }

    @Override
    public List<User_Exams_entity> findByUserId(Integer userId) {
        return user_exams_Mapper.findByUserId(userId);
    }
    
    @Override
    @Transactional
    public int addExam(User_Exams_entity exam) {
        return user_exams_Mapper.insertExam(exam);
    }
}
